home *** CD-ROM | disk | FTP | other *** search
- Path: uxa.ecn.bgu.edu!ujdeutsc
- From: ujdeutsc@uxa.ecn.bgu.edu (Deutsch Joseph)
- Newsgroups: comp.lang.c
- Subject: Re: Looking for a clear screen function
- Date: 6 Apr 1996 06:25:42 GMT
- Organization: Educational Computing Network
- Message-ID: <4k52p6$5d9@news.ecn.bgu.edu>
- References: <4gaeba$d9h@nkosi.well.com> <3129AC77.5F25@fokus.gmd.de> <TANMOY.96Feb20084655@qcd.lanl.gov> <312AC84A.3D66@connix.com>
- NNTP-Posting-Host: ecom4.ecn.bgu.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Scott Hawley (shawley@connix.com) wrote:
- : Actually you should use at least 50 instead of 25. If the cursor is at
- : the top of a 25 line screen the first 25 lines will only bring it to the
- : bottom.
-
-
- You can also try the system() function, which is a part of the ANSI C
- library. Its argument is the OS command for clearing the screen on the
- particular machine that the program is running on. Thus, on DOS machines
- you would use:
-
- system("cls");
-
- and on most UNIX machines you would use:
-
- system("clear");
-
- The real advantage to this method is that it clears the screen regardless
- of monitor size. For greater programming convenience, you could use
- conditional compiliation directives such as:
-
- #ifdef DOS
- #define CLEARMSG "cls"
- #endif
- #ifdef UNIX
- #define CLEARMSG "clear"
- #endif
-
- with system( CLEARMSG ); to handle the differences between the two OS's
- with relative ease.
- --
- __________________________________________________________________________
- |
- | |
- Joseph Deutsch | Ceci n'est pas une pipe.
- |
- __________________________|_______________________________________________
-